Skip to main content

OfficeWebAppsAPI Methods

An object defining methods for the OfficeWebAppsAPI class.

GetActionUrl(fileSecret, action, extension, cancellationToken, telemetryCollectorHolder)

Retrieves the action URL for an Office Web App, based on parameters such as the file secret, action type, and file extension.

Parameters:

fileSecret (required): string
The secret key of the file for which the action URL is being requested.

action (required): string
The specific action to be performed on the file, such as "view" or "edit."

extension (required): string
The file extension, specifying the type of file (e.g., .docx, .xlsx) for the requested Office Web App action.

cancellationToken (optional): CancellationToken
A cancellation token to observe while waiting for the task to complete. Defaults to default if not provided.

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the URL retrieval process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<GetActionUrlResponse>
Returns url for opening document in office online viewer

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


SetUrl(url)

Sets the API URL for requests.

Parameters:

url (required): string
The new API URL.

Returns:

Type: void
Method does not return anything

Exceptions:

Type: ArgumentNullException
Throws ArgumentNullException if URL is null or empty.

Type: Exception
Throws Exception if the URL is invalid.

This is a sync method. Method runs synchronously.